package com.wnnight.wys.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName: URLConfig
 * @Description: //TODO
 * @author: xjh
 * @date: 2022/9/7-20:48
 * @version: v1.0
 */
@Configuration
public class URLConfig implements WebMvcConfigurer {
    @Value("${wys.uploadPath}")
    private String uploadPath;
    @Value("${wys.uploadPath_mapping}")
    private String uploadPath_mapping;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(uploadPath_mapping+"**")
                .addResourceLocations("file:"+uploadPath);
    }
}
